package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: RoleMapper
 * Package: com.qk.mapper
 * Description:
 *
 * @Author zt
 * @Create 2025/7/27 21:52
 * @Version 1.0
 */
@Mapper
public interface RoleMapper {

    List<Role> selectByCondition(String name, String label);

    @Delete("delete from role where id = #{id}")
    void delete(Integer id);

    @Insert("insert into role(name, label, remark, create_time, update_time) " +
            "values(#{name}, #{label}, #{remark}, #{createTime}, #{updateTime})")
    void add(Role role);

    @Select("select id, name, label, remark, create_time, update_time from role where id = #{id}")
    Role getById(Integer id);

    void update(Role role);

    @Select("select id, name, label, remark, create_time, update_time from role")
    List<Role> list();
}
